package com.jsbs.iam.auth.feign;

import com.github.pagehelper.PageInfo;
import com.jsbs.iam.auth.dto.IamMenuManagerSelectDto;
import com.jsbs.iam.auth.dto.IamOrgInfoQueryDto;
import com.jsbs.iam.auth.param.IamFilterRulesParam;
import com.jsbs.iam.auth.param.IamRoleQueryUserParam;
import com.jsbs.iam.auth.vo.*;
import com.jsbs.iam.common.core.dto.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * @ClassName: IamRoleFeign
 * @Author: tenghuawei
 * @Date: 2022/12/26 17:58
 * @Description:
 */

@FeignClient(value = "iam-user",url = "${iam.user.domain:127.0.0.1:81}")
public interface IamRoleManagerFeign {

    /**
     * 功能描述：角色关联用户查询-——查询某个角色下绑定的用户
     * @param iamRoleQueryUserParam
     * @return Result
     */
    @PostMapping(value = "/iam/user/info/queryRoleBindUsers", consumes = "application/json")
    Result<PageInfo<IamUserInfoVo>> queryRoleBindUsers(IamRoleQueryUserParam iamRoleQueryUserParam);

    /**
     * 功能描述：角色关联用户查询-——查询某个角色下绑定的用户
     * @param companyCode
     * @param userCode
     * @return Result
     */
    @PostMapping(value = "/iam/user/info/queryByUserCode", consumes = "application/json")
    Result<UserInfoVo> queryByUserCode(@RequestParam("companyCode")String companyCode, @RequestParam("userCode")String userCode);

    /**
     * 功能描述：查询该角色下还未绑定的用户
     * @param iamRoleQueryUserParamm
     * @return Result
     */
    @PostMapping(value = "/iam/user/info/queryRoleNotBindUsers", consumes = "application/json")
    Result<PageInfo<IamUserInfoVo>> queryRoleNotBindUsers(IamRoleQueryUserParam iamRoleQueryUserParamm);

    /**
     * 功能描述：根据菜单编码获取菜单信息列表
     * @param menuCodeList
     * @return
     */
    @PostMapping(value = "/iam/user/getMenuInfoList", consumes = "application/json")
    Result getMenuInfoList(List<String> menuCodeList);

    /**
     * 功能描述：根据菜单编码获取菜单信息列表
     * @param buttonCodeList
     * @return
     */
    @PostMapping(value = "/iam/user/getButtonInfoList", consumes = "application/json")
    Result getButtonInfoList(List<String> buttonCodeList);

    /**
     * 功能描述：查询当前登录用户归属租户的用户类型
     * @param
     * @return Result
     */
    @PostMapping(value = "/iam/user/userType/getUserTypeData", consumes = "application/json")
    Result getUserTypeData(@RequestParam("userTypeInfo")String userTypeInfo);

    /**
     * 功能描述：根据服务域名获取应用信息
     * @param serverName
     * @return
     */
    @PostMapping(value = "/iam/user/apply/system/getApplySystem", consumes = "application/json")
    Result getApplySystem(String serverName);

    /**
     * 功能描述：获取后台IAM指定角色权限列表
     * @param adminRoleCode
     * @return
     */
    @PostMapping(value = "/iam/user/menu/admin/permisson/list", consumes = "application/json")
    Result queryAdminPermisson(@RequestParam("userCode") String userCode,@RequestParam("adminRoleCode") String adminRoleCode);

    /**
     * 功能描述：根据用户类型编码，查询扩展字段
     * @param userTypeCode
     * @return Result
     */
    @PostMapping(value = "/iam/user/info/getUserTypeExtend", consumes = "application/json")
    Result<List<IamUserTypeExtendedFieldVo>> getUserTypeExtend(@RequestParam("userTypeCode") String userTypeCode);

    /**
     * 功能描述：根据组织类型编码获取组织树（可包含岗位）
     * @param iamOrgInfoQueryDto
     * @return Result
     */
    @PostMapping(value = "/iam/user/orgInfo/getOrgTypeInfo")
    Result<List<OrgThreeInfoVo>> getOrgTypeInfo(IamOrgInfoQueryDto iamOrgInfoQueryDto);

    /**
     * 功能描述：根据应用类型编码获取菜单树（可包含按钮）
     * @param iamMenuManagerSelectDto
     * @return Result
     */
    @PostMapping(value = "/iam/user/menu/getMenuThreeInfo", consumes = "application/json")
    Result<List<MenuThreeVo>> getMenuThreeInfo(IamMenuManagerSelectDto iamMenuManagerSelectDto);

    /**
     * 功能描述：查询动态用户组下的用户（分页展示）
     * @param：iamFilterRulesParam 筛选规则条件
     * @return Result
     */
    @PostMapping(value = "/iam/user/info/queryDynamicUserGroupUserInfo", consumes = "application/json")
    Result<IamUserInfoVo> queryDynamicUserGroupUserInfo(IamFilterRulesParam iamFilterRulesParam);

    /**
     * 功能描述：根据应用编码查询应用相关信息
     * param：applyCodes
     * @return Result
     */
    @PostMapping("/iam/user/system/queryApplySystemByApplyCode")
    Result queryApplySystemByApplyCode(@RequestParam("applyCodes")Set<String> applyCodes,@RequestParam("companyCode")String companyCode);

    /**
     * 功能描述：查询管理员权限列表
     * param：roleCode
     * param：companyCode
     * @return Result
     */
    @PostMapping("/iam/user/adminRole/queryAdminRole")
    Result queryAdminRole(@RequestParam("roleCode") String roleCode,@RequestParam("companyCode") String companyCode) ;





}
